package com.xjcs.saplingplan.room.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.xjcs.saplingplan.room.bean.focus.FocusBean
import kotlinx.coroutines.flow.Flow

@Dao
interface FocusDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(bean: FocusBean)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertList(bean: List<FocusBean>)

    @Query("select * from FocusBean where focusUserId = :userId")
    fun getAllFocus(userId: String): Flow<List<FocusBean>>

}